.class public Lcom/glympse/android/glympse/ViewMap;
.super Landroid/widget/LinearLayout;
.source "ViewMap.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/glympse/android/glympse/ViewMap$DoUpdateOnMainThread;,
        Lcom/glympse/android/glympse/ViewMap$MyGlympseView;,
        Lcom/glympse/android/glympse/ViewMap$OnMapCenterClick;,
        Lcom/glympse/android/glympse/ViewMap$UserData;
    }
.end annotation


# static fields
.field public static final DEFAULT_ZOOM_LEVEL:I = 0xf

.field public static final UNKNOWN_ZOOM_LEVEL:I = 0x3


# instance fields
.field protected m_eLabelMode:Lcom/glympse/android/glympse/MapControl$ELabelMode;

.field protected m_fAdVisible:Z

.field protected m_fShowSatellite:Z

.field protected m_fShowTraffic:Z

.field protected m_fUserLocation:Z

.field protected m_nLastSetZoomLevel:I

.field public m_oGlympseView:Lcom/glympse/android/glympse/ViewMap$MyGlympseView;

.field protected m_oImageMessage:Landroid/widget/ImageView;

.field protected m_oLinearLayoutMessage:Landroid/widget/LinearLayout;

.field protected m_oRelativeLayoutMap:Landroid/widget/RelativeLayout;

.field protected m_oTextMessage:Landroid/widget/TextView;

.field protected m_oUser:Lcom/glympse/platform/common/User;

.field protected m_oZoomButton:Landroid/widget/ZoomButton;

.field protected m_oZoomControls:Landroid/widget/ZoomControls;


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 3
    .parameter "oContext"

    .prologue
    const/4 v2, 0x0

    const/4 v1, 0x0

    .line 61
    invoke-direct {p0, p1}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;)V

    .line 40
    new-instance v0, Lcom/glympse/android/glympse/ViewMap$MyGlympseView;

    invoke-direct {v0, p0}, Lcom/glympse/android/glympse/ViewMap$MyGlympseView;-><init>(Lcom/glympse/android/glympse/ViewMap;)V

    iput-object v0, p0, Lcom/glympse/android/glympse/ViewMap;->m_oGlympseView:Lcom/glympse/android/glympse/ViewMap$MyGlympseView;

    .line 42
    iput-boolean v2, p0, Lcom/glympse/android/glympse/ViewMap;->m_fShowSatellite:Z

    .line 43
    iput-boolean v2, p0, Lcom/glympse/android/glympse/ViewMap;->m_fShowTraffic:Z

    .line 44
    sget-object v0, Lcom/glympse/android/glympse/MapControl$ELabelMode;->Avatar:Lcom/glympse/android/glympse/MapControl$ELabelMode;

    iput-object v0, p0, Lcom/glympse/android/glympse/ViewMap;->m_eLabelMode:Lcom/glympse/android/glympse/MapControl$ELabelMode;

    .line 45
    const/16 v0, 0xf

    iput v0, p0, Lcom/glympse/android/glympse/ViewMap;->m_nLastSetZoomLevel:I

    .line 46
    iput-object v1, p0, Lcom/glympse/android/glympse/ViewMap;->m_oUser:Lcom/glympse/platform/common/User;

    .line 47
    iput-boolean v2, p0, Lcom/glympse/android/glympse/ViewMap;->m_fUserLocation:Z

    .line 48
    iput-boolean v2, p0, Lcom/glympse/android/glympse/ViewMap;->m_fAdVisible:Z

    .line 50
    iput-object v1, p0, Lcom/glympse/android/glympse/ViewMap;->m_oRelativeLayoutMap:Landroid/widget/RelativeLayout;

    .line 51
    iput-object v1, p0, Lcom/glympse/android/glympse/ViewMap;->m_oZoomControls:Landroid/widget/ZoomControls;

    .line 52
    iput-object v1, p0, Lcom/glympse/android/glympse/ViewMap;->m_oZoomButton:Landroid/widget/ZoomButton;

    .line 53
    iput-object v1, p0, Lcom/glympse/android/glympse/ViewMap;->m_oLinearLayoutMessage:Landroid/widget/LinearLayout;

    .line 54
    iput-object v1, p0, Lcom/glympse/android/glympse/ViewMap;->m_oImageMessage:Landroid/widget/ImageView;

    .line 55
    iput-object v1, p0, Lcom/glympse/android/glympse/ViewMap;->m_oTextMessage:Landroid/widget/TextView;

    .line 62
    return-void
.end method

.method private GetUserData(Lcom/glympse/platform/common/User;)Lcom/glympse/android/glympse/ViewMap$UserData;
    .locals 1
    .parameter "oUser"

    .prologue
    .line 94
    iget-object v0, p1, Lcom/glympse/platform/common/User;->m_oUserData:Ljava/lang/Object;

    if-nez v0, :cond_0

    .line 96
    new-instance v0, Lcom/glympse/android/glympse/ViewMap$UserData;

    invoke-direct {v0, p0}, Lcom/glympse/android/glympse/ViewMap$UserData;-><init>(Lcom/glympse/android/glympse/ViewMap;)V

    iput-object v0, p1, Lcom/glympse/platform/common/User;->m_oUserData:Ljava/lang/Object;

    .line 98
    :cond_0
    iget-object p0, p1, Lcom/glympse/platform/common/User;->m_oUserData:Ljava/lang/Object;

    .end local p0
    check-cast p0, Lcom/glympse/android/glympse/ViewMap$UserData;

    return-object p0
.end method

.method private ShowHideMessage(I)V
    .locals 5
    .parameter "nAction"

    .prologue
    const/4 v3, 0x1

    const/4 v4, 0x0

    .line 105
    iget-object v2, p0, Lcom/glympse/android/glympse/ViewMap;->m_oTextMessage:Landroid/widget/TextView;

    if-eqz v2, :cond_0

    .line 108
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v2

    iget-object v2, v2, Lcom/glympse/platform/Platform;->m_oUserList:Lcom/glympse/platform/common/UserList;

    iget-object v2, v2, Lcom/glympse/platform/common/UserList;->m_oActiveUser:Lcom/glympse/platform/common/User;

    invoke-direct {p0, v2}, Lcom/glympse/android/glympse/ViewMap;->GetUserData(Lcom/glympse/platform/common/User;)Lcom/glympse/android/glympse/ViewMap$UserData;

    move-result-object v1

    .line 111
    .local v1, oUserData:Lcom/glympse/android/glympse/ViewMap$UserData;
    iget-object v2, p0, Lcom/glympse/android/glympse/ViewMap;->m_oTextMessage:Landroid/widget/TextView;

    invoke-virtual {v2}, Landroid/widget/TextView;->getVisibility()I

    move-result v2

    if-nez v2, :cond_1

    move v0, v3

    .line 114
    .local v0, fIsVisible:Z
    :goto_0
    if-lez p1, :cond_2

    move v2, v3

    :goto_1
    iput-boolean v2, v1, Lcom/glympse/android/glympse/ViewMap$UserData;->m_fMessageVisible:Z

    .line 118
    iget-boolean v2, v1, Lcom/glympse/android/glympse/ViewMap$UserData;->m_fMessageVisible:Z

    if-eq v0, v2, :cond_0

    .line 120
    iget-object v2, p0, Lcom/glympse/android/glympse/ViewMap;->m_oTextMessage:Landroid/widget/TextView;

    iget-boolean v3, v1, Lcom/glympse/android/glympse/ViewMap$UserData;->m_fMessageVisible:Z

    if-eqz v3, :cond_5

    move v3, v4

    :goto_2
    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setVisibility(I)V

    .line 121
    iget-object v2, p0, Lcom/glympse/android/glympse/ViewMap;->m_oImageMessage:Landroid/widget/ImageView;

    iget-boolean v3, v1, Lcom/glympse/android/glympse/ViewMap$UserData;->m_fMessageVisible:Z

    if-eqz v3, :cond_6

    const v3, 0x7f02007b

    :goto_3
    invoke-virtual {v2, v3}, Landroid/widget/ImageView;->setImageResource(I)V

    .line 124
    .end local v0           #fIsVisible:Z
    .end local v1           #oUserData:Lcom/glympse/android/glympse/ViewMap$UserData;
    :cond_0
    return-void

    .restart local v1       #oUserData:Lcom/glympse/android/glympse/ViewMap$UserData;
    :cond_1
    move v0, v4

    .line 111
    goto :goto_0

    .line 115
    .restart local v0       #fIsVisible:Z
    :cond_2
    if-nez p1, :cond_3

    move v2, v4

    goto :goto_1

    :cond_3
    if-eqz v0, :cond_4

    move v2, v4

    goto :goto_1

    :cond_4
    move v2, v3

    goto :goto_1

    .line 120
    :cond_5
    const/16 v3, 0x8

    goto :goto_2

    .line 121
    :cond_6
    const v3, 0x7f02007a

    goto :goto_3
.end method

.method static synthetic access$0(Lcom/glympse/android/glympse/ViewMap;I)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 102
    invoke-direct {p0, p1}, Lcom/glympse/android/glympse/ViewMap;->ShowHideMessage(I)V

    return-void
.end method

.method static synthetic access$1(Lcom/glympse/android/glympse/ViewMap;Lcom/glympse/platform/common/User;)Lcom/glympse/android/glympse/ViewMap$UserData;
    .locals 1
    .parameter
    .parameter

    .prologue
    .line 92
    invoke-direct {p0, p1}, Lcom/glympse/android/glympse/ViewMap;->GetUserData(Lcom/glympse/platform/common/User;)Lcom/glympse/android/glympse/ViewMap$UserData;

    move-result-object v0

    return-object v0
.end method


# virtual methods
.method public PanningChanged()V
    .locals 2

    .prologue
    .line 75
    iget-object v0, p0, Lcom/glympse/android/glympse/ViewMap;->m_oZoomButton:Landroid/widget/ZoomButton;

    if-eqz v0, :cond_0

    .line 77
    iget-object v0, p0, Lcom/glympse/android/glympse/ViewMap;->m_oZoomButton:Landroid/widget/ZoomButton;

    sget-object v1, Lcom/glympse/android/glympse/Glympse;->ms_oThis:Lcom/glympse/android/glympse/Glympse;

    iget-object v1, v1, Lcom/glympse/android/glympse/Glympse;->m_oMapControl:Lcom/glympse/android/glympse/MapControl;

    iget-boolean v1, v1, Lcom/glympse/android/glympse/MapControl;->m_fPanning:Z

    invoke-virtual {v0, v1}, Landroid/widget/ZoomButton;->setEnabled(Z)V

    .line 79
    :cond_0
    return-void
.end method

.method public SetZoom(Lcom/glympse/android/glympse/ViewMap$UserData;)V
    .locals 3
    .parameter "oUserData"

    .prologue
    .line 67
    if-nez p1, :cond_0

    iget v1, p0, Lcom/glympse/android/glympse/ViewMap;->m_nLastSetZoomLevel:I

    move v0, v1

    .line 68
    .local v0, nUserLevel:I
    :goto_0
    sget-object v1, Lcom/glympse/android/glympse/Glympse;->ms_oThis:Lcom/glympse/android/glympse/Glympse;

    iget-object v1, v1, Lcom/glympse/android/glympse/Glympse;->m_oMapControl:Lcom/glympse/android/glympse/MapControl;

    iget-object v1, v1, Lcom/glympse/android/glympse/MapControl;->m_oMapController:Lcom/google/android/maps/MapController;

    .line 69
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v2

    iget-object v2, v2, Lcom/glympse/platform/Platform;->m_oUserList:Lcom/glympse/platform/common/UserList;

    iget-object v2, v2, Lcom/glympse/platform/common/UserList;->m_oActiveUser:Lcom/glympse/platform/common/User;

    invoke-virtual {v2}, Lcom/glympse/platform/common/User;->HasLocation()Z

    move-result v2

    if-eqz v2, :cond_1

    move v2, v0

    .line 68
    :goto_1
    invoke-virtual {v1, v2}, Lcom/google/android/maps/MapController;->setZoom(I)I

    .line 70
    return-void

    .line 67
    .end local v0           #nUserLevel:I
    :cond_0
    iget v1, p1, Lcom/glympse/android/glympse/ViewMap$UserData;->m_nZoomLevel:I

    move v0, v1

    goto :goto_0

    .line 69
    .restart local v0       #nUserLevel:I
    :cond_1
    const/4 v2, 0x3

    goto :goto_1
.end method

.method public ZoomChanged()V
    .locals 2

    .prologue
    .line 84
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v0

    iget-object v0, v0, Lcom/glympse/platform/Platform;->m_oUserList:Lcom/glympse/platform/common/UserList;

    iget-object v0, v0, Lcom/glympse/platform/common/UserList;->m_oActiveUser:Lcom/glympse/platform/common/User;

    invoke-virtual {v0}, Lcom/glympse/platform/common/User;->HasLocation()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 86
    sget-object v0, Lcom/glympse/android/glympse/Glympse;->ms_oThis:Lcom/glympse/android/glympse/Glympse;

    iget-object v0, v0, Lcom/glympse/android/glympse/Glympse;->m_oMapControl:Lcom/glympse/android/glympse/MapControl;

    invoke-virtual {v0}, Lcom/glympse/android/glympse/MapControl;->getZoomLevel()I

    move-result v0

    iput v0, p0, Lcom/glympse/android/glympse/ViewMap;->m_nLastSetZoomLevel:I

    .line 87
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v0

    iget-object v0, v0, Lcom/glympse/platform/Platform;->m_oUserList:Lcom/glympse/platform/common/UserList;

    iget-object v0, v0, Lcom/glympse/platform/common/UserList;->m_oActiveUser:Lcom/glympse/platform/common/User;

    invoke-direct {p0, v0}, Lcom/glympse/android/glympse/ViewMap;->GetUserData(Lcom/glympse/platform/common/User;)Lcom/glympse/android/glympse/ViewMap$UserData;

    move-result-object v0

    iget v1, p0, Lcom/glympse/android/glympse/ViewMap;->m_nLastSetZoomLevel:I

    iput v1, v0, Lcom/glympse/android/glympse/ViewMap$UserData;->m_nZoomLevel:I

    .line 89
    :cond_0
    return-void
.end method
